package com.heima.wemedia.feign;

import com.heima.feign.wemedia.ISensitiveClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.WmSensitiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author rookie001
 * @creat 2023-06-19-16:02
 */
@RestController
public class WmSensitiveClient implements ISensitiveClient {
    @Autowired
    private WmSensitiveService wmSensitiveService;

    //查询敏感词
    @PostMapping("/api/v1/sensitive/list")
    public ResponseResult list(@RequestBody SensitiveDto dto) {
        return wmSensitiveService.listService(dto);
    }


    //删除敏感词
    @DeleteMapping("/api/v1/sensitive/del/{id}")
    public ResponseResult del(@PathVariable Integer id) {
        return wmSensitiveService.delService(id);
    }
    //保存敏感词
    @PostMapping("/api/v1/sensitive/save")
    public ResponseResult save(@RequestBody WmSensitive wmSensitive){
        return wmSensitiveService.saveService(wmSensitive);
    }
    //更新敏感词
    @PostMapping("/api/v1/sensitive/update")
    public ResponseResult update(WmSensitive wmSensitive) {
      return  wmSensitiveService.updateService(wmSensitive);
    }
}
